/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    
package be.vdabantwerpen.gow.entities;
    
import java.io.Serializable;

/**
 *
 * @author tim.vandenlangenberg
 * @version 0.1
 */
public class Weight implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private String actionType;
    private int weight;
    
    protected Weight(){
        
    }
    
    public Weight(String actionType, int weight){
        setActionType(actionType);
        setWeight(weight);
    }
    
    public void setActionType(String actionType){
        this.actionType = actionType;
    }
    
    public void setWeight(int weight){
        this.weight = weight;
    }
    
    public String getActionType(){
        return actionType;
    }
    
    public int getWeight(){
        return weight;
    }
    
    @Override
    public boolean equals(Object obj){
        if(obj instanceof Weight){
            Weight w = (Weight) obj;
            return (w.getActionType().equalsIgnoreCase(this.actionType) && 
                    w.getWeight() == this.weight);
        }
        else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return actionType.toUpperCase().hashCode();
    }
    
}
